﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.ServiceModel.Web;
using System.IO;

namespace elr_tracking_web.Services
{
    [ServiceContract]
    public interface IUser
    {
        /// <summary>
        /// Agregar Usuario
        /// </summary>
        /// <param name="ID_USER"></param>
        /// <param name="USER_NAME"></param>
        /// <param name="USER_MAIL"></param>
        /// <param name="PASSWORD"></param>
        /// <param name="DEFAULT_PAGE"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        elr_tracking_bal.UpsertStateMsg InsertUser(string USER_NAME, string USER_MAIL, string PASSWORD, string DEFAULT_PAGE);
        /// <summary>
        /// Borrar Usuario
        /// </summary>
        /// <param name="ID_USER"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        elr_tracking_bal.DeleteStateMsg DeleteUser(string ID_USER);
        /// <summary>
        /// Actualizar Usuario
        /// </summary>
        /// <param name="ID_USER"></param>
        /// <param name="USER_NAME"></param>
        /// <param name="USER_MAIL"></param>
        /// <param name="PASSWORD"></param>
        /// <param name="DEFAULT_PAGE"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        elr_tracking_bal.UpsertStateMsg UpdateUser(int ID_USER, string USER_NAME, string USER_MAIL, string PASSWORD, string DEFAULT_PAGE);
        /// <summary>
        /// Recuperar Usuario
        /// </summary>
        /// <param name="ID_ROL"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        elr_tracking_bal.APP_USER GetOneUser(int ID_USER);
        /// <summary>
        /// Recuperar todos los Usuarios
        /// </summary>
        /// <param name="ID_USER"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<elr_tracking_bal.APP_USER> GetDataListUser(string ID_USER); 
        /// <summary>
        /// Agregar Rol
        /// </summary>
        /// <param name="ID_ROL"></param>
        /// <param name="ROL_NAME"></param>
        /// <param name="ROL_PRIORITY"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        elr_tracking_bal.UpsertStateMsg InsertRol(string ROL_NAME, int ROL_PRIORITY);
        /// <summary>
        /// Eliminar Rol
        /// </summary>
        /// <param name="ID_ROL"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        elr_tracking_bal.DeleteStateMsg DeleteRol(string ID_ROL);
        /// <summary>
        /// Modificar Rol
        /// </summary>
        /// <param name="ID_ROL"></param>
        /// <param name="ROL_NAME"></param>
        /// <param name="ROL_PRIORITY"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        elr_tracking_bal.UpsertStateMsg UpdateRol(int ID_ROL, string ROL_NAME, int ROL_PRIORITY);
        /// <summary>
        /// Recuperar un rol
        /// </summary>
        /// <param name="ID_ROL"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        elr_tracking_bal.APP_ROL GetOneRol(int ID_ROL);
        /// <summary>
        /// Recuperar todos los roles
        /// </summary>
        /// <param name="ID_ROL"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<elr_tracking_bal.APP_ROL> GetDataListRol(string ID_ROL);
        /// <summary>
        /// Recupera la información de las columnas de una tabla
        /// </summary>
        /// <param name="NAME_TABLE"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<elr_tracking_bal.INFORMATION_COLUMNS> GetInformationColumns(string NAME_TABLE);
        /// <summary>
        /// Crea la relación entre usuario y roles
        /// </summary>
        /// <param name="ID_USER"></param>
        /// <param name="ROLES"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        elr_tracking_bal.UpsertStateMsg insertRelUserRol(int ID_USER, string ROLES);
        /// <summary>
        /// Obtenere los roles checkeados
        /// </summary>
        /// <param name="ID_USER"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<elr_tracking_bal.APP_USER> GetListRolChecked(string ID_USER);
        /// <summary>
        /// Valida el inicio de sesión del usuario
        /// </summary>
        /// <param name="USER_MAIL"></param>
        /// <param name="PASSWORD"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        elr_tracking_bal.APP_USER ValidateUser(string USER_MAIL, string PASSWORD);
        /// <summary>
        /// Cambia el estado de la columna FLAG a 1
        /// </summary>
        /// <param name="FLAG"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        string UpdateFlagRecoverUserPassword(string USER_MAIL);
        /// <summary>
        /// Cambia la columna Activo a 1 a través del código enviado por correo
        /// </summary>
        /// <param name="codigo"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        string UpdateflagActivacion(string codigo);
        /// <summary>
        /// Obtiene el Mail del Usuario a trvés del código enviado por correo
        /// </summary>
        /// <param name="codigo"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        string GetOneMail(string codigo);
    }
}
     